home *** CD-ROM | disk | FTP | other *** search
Text File | 1991-12-21 | 28.7 KB | 1,129 lines |
- Newsgroups: comp.sources.unix
- From: terry@cogsci.indiana.edu (Terry Jones)
- Subject: v25i088: rcsify - put groups of files under RCS control
- Sender: sources-moderator@pa.dec.com
- Approved: vixie@pa.dec.com
-
- Submitted-By: terry@cogsci.indiana.edu (Terry Jones)
- Posting-Number: Volume 25, Issue 88
- Archive-Name: rcsify
-
- Rcsify is a shell script intended for getting things going with RCS. It
- adds Header and Log lines to all manner of files (easily extendable),
- creates an RCS directory and checks in the files. It checks in with the -k
- option if Header and Log entries exist in the file and uses rcs -c to set
- the comment leader correctly on the new revision groups that are created. It
- can be used recursively to descend a directory tree. File types are
- recognised based on suffixes, though the -f option can be used to get extra
- help from file(1). Files of unrecognised type are ignored under the
- assumption that they probably aren't the sort of files you want to maintain
- with RCS anyway.
-
- It does the right thing with files that start with the #! directive and also
- more complicated .lex, .y and .gperf files.
-
- It's trivial to use and I (at least) use it all the time.
-
- You need a shell with functions and an echo that allows embedded \n will
- definitely be an advantage.
-
- See the man page for details.
-
- Terry Jones
- terry@cogsci.indiana.edu
-
- #! /bin/sh
- # This is a shell archive. Remove anything before this line, then unpack
- # it by saving it into a file and typing "sh file". To overwrite existing
- # files, type "sh file -c". You can also feed this as standard input via
- # unshar, or by typing "sh <file", e.g.. If this archive is complete, you
- # will see the following message at the end:
- # "End of shell archive."
- # Contents: rcsify rcsify.1 Makefile MANIFEST
- # Wrapped by tjones@iuvax on Fri Dec 7 08:00:19 1990
- PATH=/bin:/usr/bin:/usr/ucb ; export PATH
- if test -f 'rcsify' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'rcsify'\"
- else
- echo shar: Extracting \"'rcsify'\" \(19368 characters\)
- sed "s/^X//" >'rcsify' <<'END_OF_FILE'
- X#!/bin/sh
- X#
- X# $Header: /home/cogsci1/u2/terry/s/rcsify/RCS/rcsify,v 1.2 90/12/07 07:37:39 terry Exp Locker: terry $
- X#
- X
- X#
- X# rcsify - add RCS Header and Log headers to the start
- X# of files, then check them in (with -k if needed).
- X#
- X# usage: rcsify [-aflmNnqruv] [-help] [files...]
- X#
- X# -a Do all files, e.g. * and .* (excluding . and ..)
- X# -f use file(1) to help determine file types.
- X# -l check-in uses -l
- X# -m check in makefiles too.
- X# -N No check in, just add Header and Log.
- X# -n like make -n
- X# -q be quiet. no output is given.
- X# -r treat directories recursively.
- X# -u check-in uses -u
- X# -v verbose output.
- X#
- X# No files => files = *
- X#
- X# NOTE:
- X# Do NOT expand this file, it contains important TABS.
- X# This file can be maintained by RCS. For that reason we cannot
- X# mention the strings dollar_sign Header dollar_sign or
- X# dollar_sign Log dollar_sign anywhere, except in the actual
- X# header and actual log.
- X#
- X#
- X# NOTE for people planning to add new file suffix recognition.
- X#
- X# Usually this is very simple. Look at the "case $i in" case
- X# statement and decide where to put your new suffix. If the
- X# header lines will be the same as for some other suffix, just
- X# add the suffix to that case and you're done. For example, I
- X# just added the "*.perl" case to the "*.sh | *.awk" line
- X# since perl's commenting convention is the same as the shell's
- X# and so is awk's.
- X#
- X# If there is no suitable template there already, make a new case
- X# and follow the examples for other cases. You must make a header
- X# and log string and set the hdr and log variables. Also set
- X# comment to be the comment leader if this file type is not known
- X# by RCS (the chances are it wont be).
- X#
- X# If your file type cannot take the header and log information
- X# at the beginning, set fiddle to something meaningful and
- X# catch it later on in the "case $fiddle in" case statement.
- X# Take a look at what I do when finding a lex file or a shell
- X# script. Good luck, it's not hard.
- X#
- X# Remember to update the man page too.
- X#
- X
- X# Terry Jones (terry@cogsci.indiana.edu) December 7th, 1990.
- X# Center for Research on Concepts & Cognition
- X# 510 North Fess
- X# Indiana University
- X# Bloomington IN 47405 USA
- X#
- X# Largely written at PCS Computer Systeme GmbH, Munich.
- X#
- X
- X#
- X# $Log: rcsify,v $
- X# Revision 1.2 90/12/07 07:37:39 terry
- X# Added a few new suffixes.
- X#
- X# Revision 1.1 90/12/07 07:03:47 terry
- X# Initial revision
- X#
- X
- X
- Xfullname=$0
- Xmyname=`basename $0`
- Xcwd=`pwd`
- Xnew_file=/tmp/_,_,rcs$$
- Xwarning="echo ${myname}: WARNING..."
- Xreport="echo ${myname}:"
- Xverbose=:
- Xcheck_in=
- Xrecursive=
- Xoptions=
- Xci_flags=
- Xall=
- Xuse_file=
- Xmake=
- X
- X#
- X# You need an echo that can handle embedded newlines (\n) etc.
- X# For system 5 people, /bin/echo does the job. On SUNs, use
- X# /usr/5bin/echo. Elsewhere???
- X#
- X# echo=/bin/echo
- Xecho=/usr/5bin/echo
- X
- X#
- X# The two variables x and X are used to control whether or not
- X# lines are actually executed or not. Under normal
- X# circumstances both are "". $x or $X is placed in front of
- X# lines that do things to files etc. So normally the $x or
- X# $X expands to nothing and the line is actually done.
- X#
- X# If -n is given then we wish to turn off actual processing
- X# but still want to see the commands that would have been done.
- X# in this case we assign x=echo and X=:
- X# Then, put $x in front of a line you want echoed and $X in
- X# front of a line you want not done and not echoed. It is
- X# important to note that you cannot put $x in front of a
- X# line that contains certains metacharacters (e.g. <, >, |)
- X# since echo's IO will be affected. In these few cases I
- X# test the value of $x and do the echo that way. It is also
- X# important to note that you can't put "" in front of a
- X# line that calls a builtin function (like if).
- X#
- X# "" if [ a = b ]
- X# if: command not found
- X#
- Xx=
- XX=
- X
- Xusage()
- X{
- X $echo usage: $myname "[-aflmnNqruv] [files...]"
- X exit_status=1
- X exit
- X}
- X
- X#
- X# Get options.
- X#
- Xwhile [ $# -ne 0 ]
- Xdo
- X case $1 in
- X -a) all=1; options="$options $1"; shift;;
- X -f) use_file=1; options="$options $1"; shift;;
- X -help | -h | "-?") usage; exit 0;;
- X -l) ci_flags="$ci_flags $1"; options="$options $1"; shift;;
- X -m) make=1; options="$options $1"; shift;;
- X -n) x=1; X=:; options="$options $1"; shift;;
- X -N) check_in=0; options="$options $1"; shift;;
- X -q) report=:; options="$options $1"; shift;;
- X -[rR]) recursive=1; options="$options $1"; shift;;
- X -u) ci_flags="$ci_flags $1"; options="$options $1"; shift;;
- X -v) verbose="$echo ${myname}:"; options="$options $1"; shift;;
- X *) break;;
- X esac
- Xdone
- X
- X#
- X# Do this now since if the options were given as -n -q
- X# then up above we would have set x to be report before
- X# setting report to be : Get it?
- X# (-q -n would have been fine).
- X#
- Xcase "$x" in
- X 1) x="$report" ;;
- Xesac
- X
- X#
- X# Check to see if we have any files to process. If not use, "*".
- X# Make sure that the * is expanded now, not in the for loop
- X# below (or else we'll get the new RCS directory too).
- X# A minor point.
- X#
- X# Make sure that you say * .* in the echo that goes into sed.
- X# Otherwise (.* *) you will need to match against different
- X# things (start of line).
- X#
- Xcase $# in
- X 0)
- X case $all in
- X 1) files="`$echo * .* | sed -e 's/ \. / /' -e 's/ \.\. / /' -e 's/ \.$/ /' -e 's/ \.\.$/ /'`" ;;
- X "") files="`$echo *`" ;;
- X esac
- X ;;
- X *) files="$*";;
- Xesac
- X
- Xtrap 'rm -f $new_file; $verbose cleaning up.; exit 1' 1 2 3 13 15
- Xtrap 'rm -f $new_file; $verbose cleaning up.; exit $exit_status' 0
- X
- X#
- X# This assigns a value to a string as long as the string is not
- X# already assigned. NOTE the unneccesary (to the shell) '' in the
- X# middle of each assignment. This is to hide the fatal Header and
- X# Log strings from RCS - so we can maintain this file with RCS.
- X# See the NOTE at the top of this file.
- X#
- Xmake_str()
- X{
- X case "`eval $echo '$'$1`" in
- X "") ;;
- X *) return;;
- X esac
- X
- X #
- X # It might make sense to export these strings...
- X # Depends if we are recursive. May not be worth it anyway.
- X #
- X # If you don't have an echo that can take \n, this is where
- X # you will feel it. One solution would be to build the strings
- X # like
- X #
- X # string=`echo 'line_1Zline_2Zline_3ZZ' | tr Z '\012'`
- X #
- X # which isn't alot of fun, but would work.
- X #
- X
- X case $1 in
- X c_hdr) c_hdr='#ifndef lint\nstatic char *rcsid = "$Header''$";\n#endif\n\n';;
- X c_log) c_log='\n/*\n * $Log''$\n *\n */\n';;
- X doth_hdr) doth_hdr='/* $Header''$ */';;
- X doth_log) doth_log='\n/*\n * $Log''$\n *\n */\n';;
- X sh_hdr) sh_hdr='#\n# $Header''$\n#\n';;
- X sh_log) sh_log='#\n# $Log''$\n#\n';;
- X troff_hdr) troff_hdr='.\\"\n.\\" $Header''$\n.\\"';;
- X troff_log) troff_log='.\\"\n.\\" $Log''$\n.\\"';;
- X lisp_hdr) lisp_hdr=';;;\n;;; $Header''$\n;;;\n';;
- X lisp_log) lisp_log=';;;\n;;; $Log''$\n;;;\n';;
- X tex_hdr) tex_hdr='%\n% $Header''$\n%\n';;
- X tex_log) tex_log='%\n% $Log''$\n%\n';;
- X texinfo_hdr) texinfo_hdr='@comment\n@comment $Header''$\n@comment\n';;
- X texinfo_log) texinfo_log='@comment\n@comment $Log''$\n@comment\n';;
- X ti_hdr) ti_hdr='#\n# $Header''$\n#';;
- X ti_log) ti_log='#\n# $Log''$\n#';;
- X esac
- X}
- X
- X#
- X# Now process each file in turn. If something goes wrong, set exit_status=1
- X# and continue. That way when we exit (see the traps above) we will get the
- X# status from the last file processed.
- X#
- Xfor i in $files
- Xdo
- X exit_status=0
- X
- X #
- X # go back to the invocation directory, so we can process the next
- X # file. We need to do this since the "file" may have a leading
- X # pathname that does not start with a '/' (i.e. that is relative to
- X # cwd).
- X #
- X cd $cwd
- X
- X dir=`dirname $i`
- X i=`basename $i`
- X
- X #
- X # Check to see if we need to move elsewhere.
- X #
- X if [ ! "$dir" = "." ]
- X then
- X cd "$dir"
- X else
- X dir="$cwd"
- X fi
- X
- X if [ ! -w . ]
- X then
- X $warning directory $dir is not writeable
- X exit_status=1
- X exit
- X fi
- X
- X $verbose "doing directory: ${dir}, file: $i"
- X
- X #
- X # Eliminate a few nasties.
- X #
- X case $i in
- X RCS | . | ..) $verbose directory $dir/$i ignored.; continue;;
- X esac
- X
- X #
- X # Recursively handle directories if -r was given, else ignore.
- X #
- X if [ -d $i ]
- X then
- X case $recursive in
- X 1)
- X $verbose calling ourselves to handle subdirectory $dir/$i
- X cd $i && $fullname $options
- X #
- X # get back to where we were. Need the two cd's because
- X # dir may not start with a '/' and that would mean it is
- X # relative to cwd.
- X #
- X cd $cwd
- X cd $dir
- X $verbose popped up a recursion level, now back at $dir
- X ;;
- X
- X "")
- X $verbose ignored directory $dir/$i
- X ;;
- X esac
- X continue
- X fi
- X
- X #
- X # Make a new RCS directory if one doesn't exist.
- X #
- X if [ -d RCS ]
- X then
- X newRCS=0
- X else
- X newRCS=1
- X $report creating new RCS directory ${dir}/RCS
- X $x mkdir RCS
- X fi
- X #
- X # If the RCS file exists in ./RCS then do nothing.
- X #
- X
- X if [ -f RCS/${i},v ]
- X then
- X $report $dir/RCS/${i},v exists, if you just want to check $i in, use ci.
- X exit_status=1
- X continue
- X fi
- X
- X #
- X # If an RCS revision group for this file exists in the current directory,
- X # move it to ./RCS and complain a bit.
- X #
- X if [ -f ${i},v ]
- X then
- X $report revision group $dir/${i},v exists, I moved it to $dir/RCS/${i},v
- X $x mv ${i},v ./RCS
- X $report if you just want to check $i in, use ci.
- X exit_status=1
- X continue
- X fi
- X
- X #
- X # Figure out what sort of file we have. Then we will know what sort of
- X # header to stick in it and what sort of comment leader it should
- X # have.
- X #
- X # fiddle indicates whether we have a .y or .lex or .gperf file
- X # if we do, then we have to put the header and log stuff in AFTER
- X # the initial %{ in the file.
- X #
- X # comment indicates the comment type. It is "" if RCS knows about
- X # this type of file.
- X #
- X # type tells us what sort of headers to use. It will be used to build
- X # the hdr and log variables with eval.
- X #
- X # need tells us whether we need to add some header or log info.
- X #
- X
- X fiddle=
- X hdr=
- X log=
- X comment=
- X need=1
- X minus_k=
- X
- X case $i in
- X
- X *,v)
- X $report $dir/$i is already an RCS revision group, moved to ./RCS
- X $x mv $i ./RCS
- X continue
- X ;;
- X
- X *.y)
- X fiddle=lex
- X $X make_str c_hdr
- X $X make_str c_log
- X hdr="$c_hdr"
- X log="$c_log"
- X ;;
- X
- X *.lex | *.gperf)
- X fiddle=lex
- X $X make_str c_hdr
- X $X make_str c_log
- X hdr="$c_hdr"
- X log="$c_log"
- X comment=' * '
- X ;;
- X
- X *.[cs] | *.c++)
- X $X make_str c_hdr
- X $X make_str c_log
- X hdr="$c_hdr"
- X log="$c_log"
- X ;;
- X
- X *.h)
- X $X make_str doth_hdr
- X $X make_str c_log
- X hdr="$doth_hdr"
- X log="$c_log"
- X ;;
- X
- X *.sh | *.awk | *.perl)
- X fiddle=hash_bang
- X $X make_str sh_hdr
- X $X make_str sh_log
- X hdr="$sh_hdr"
- X log="$sh_log"
- X comment='# '
- X ;;
- X
- X *.ms | *.me | *.mm | *.man | *.[1-6] )
- X $X make_str troff_hdr
- X $X make_str troff_log
- X hdr="$troff_hdr"
- X log="$troff_log"
- X comment='.\\" '
- X ;;
- X
- X *.texinfo)
- X $X make_str texinfo_hdr
- X $X make_str texinfo_log
- X hdr="$texinfo_hdr"
- X log="$texinfo_log"
- X comment='@comment '
- X ;;
- X
- X *.tex | *.latex)
- X $X make_str tex_hdr
- X $X make_str tex_log
- X hdr="$tex_hdr"
- X log="$tex_log"
- X comment='% '
- X ;;
- X
- X *.el | *.lsp | *.lisp | *.ss | *.scm | *.cl)
- X $X make_str lisp_hdr
- X $X make_str lisp_log
- X hdr="$lisp_hdr"
- X log="$lisp_log"
- X comment=';;; '
- X ;;
- X
- X *.mk | [Mm]akefile | GNUmakefile | Imakefile)
- X case "$make" in
- X 1)
- X $X make_str sh_hdr
- X $X make_str sh_log
- X hdr="$sh_hdr"
- X log="$sh_log"
- X comment='# '
- X ;;
- X "")
- X continue
- X ;;
- X esac
- X ;;
- X
- X *.ti)
- X $X make_str ti_hdr
- X $X make_str ti_log
- X hdr="$ti_hdr"
- X log="$ti_log"
- X comment='# '
- X ;;
- X
- X *)
- X case "$use_file" in
- X 1)
- X case "`file $i | sed -e 's/.*:[ ]*//' -e 's/symbolic link to //'`" in
- X "c program"*|"assembler program"*)
- X $X make_str c_hdr
- X $X make_str c_log
- X hdr="$c_hdr"
- X log="$c_log"
- X comment=' * '
- X ;;
- X
- X "executable script"*|"commands text"*)
- X fiddle=hash_bang
- X $X make_str sh_hdr
- X $X make_str sh_log
- X hdr="$sh_hdr"
- X log="$sh_log"
- X comment='# '
- X ;;
- X
- X "[nt]roff, tbl,"*)
- X $X make_str troff_hdr
- X $X make_str troff_log
- X hdr="$troff_hdr"
- X log="$troff_log"
- X comment='.\\" '
- X ;;
- X
- X *)
- X $verbose "I don't know the type of $dir/$i so it will not be checked-in."
- X continue
- X ;;
- X esac
- X ;;
- X
- X "")
- X $verbose "I don't know the type of $dir/$i so it will not be checked-in."
- X continue
- X ;;
- X esac
- X ;;
- X esac
- X
- X #
- X # Must be able to read the current file.
- X #
- X if [ ! -r $i ]
- X then
- X $warning cannot read $dir/$i
- X exit_status=1
- X continue
- X fi
- X
- X #
- X # Check to see if the file already has RCS info fields in it.
- X #
- X
- X egrep '\$Header' $i >/dev/null 2>&1
- X have_hdr=$?
- X
- X egrep '\$Log' $i >/dev/null 2>&1
- X have_log=$?
- X
- X #
- X # Make header_info contain what is needed: either both Header and Log,
- X # or just Header, or just Log. Set need=0 if we don't need
- X # anything in this file.
- X #
- X
- X if [ $have_hdr -ne 0 -a $have_log -ne 0 ]
- X then
- X header_info="$hdr$log"
- X add_str="Header and Log"
- X $verbose RCS $add_str information will be added to $dir/$i
- X elif [ $have_hdr -ne 0 ]
- X then
- X header_info="$hdr"
- X add_str="Header"
- X $verbose RCS $add_str information will be added to $dir/$i
- X elif [ $have_log -ne 0 ]
- X then
- X header_info="$log"
- X add_str="Log"
- X $verbose RCS $add_str information will be added to $dir/$i
- X else
- X header_info=
- X need=0
- X fi
- X
- X #
- X # If some info is needed, add it.
- X #
- X if [ $need -eq 1 ]
- X then
- X #
- X # Are we doing this for real? If not then skip this section.
- X # It's too hard to give verbose info on what we're doing
- X # if we're not really doing it.
- X #
- X if [ -z "$x" ]
- X then
- X case $fiddle in
- X lex)
- X #
- X # Fiddle with the .y or .lex or .gperf file
- X # We break it into two pieces using sed. We do a check to see
- X # that the character counts are ok too.
- X # Then cat the pieces back into the new file, with the header
- X # stuff in the middle.
- X #
- X
- X line="`egrep -n '^[ ]*%{[ ]*$' $i | cut -d: -f1`"
- X if [ $? -eq 0 -a -n "$line" ]
- X then
- X sed -e 1,$line\!d $i > $new_file
- X line=`expr $line + 1`
- X $echo "$header_info" >> $new_file
- X sed -e $line,\$\!d $i >> $new_file
- X
- X #
- X # Simple check that all is well.
- X #
- X result_sz=`wc -c < $new_file`
- X head_len=`$echo "$header_info" | wc -c`
- X orig_sz=`wc -c < $i`
- X
- X if [ "$result_sz" -ne "`expr $orig_sz + $head_len`" ]
- X then
- X $report "bad checksum after split of file $dir/${i}. (file ignored)"
- X continue
- X fi
- X else
- X $report "could not locate '%{' line in $dir/${i}. (file ignored)"
- X exit_status=1
- X continue
- X fi
- X ;;
- X
- X hash_bang)
- X #
- X # Watch for files that start with #!...
- X # For these, we make a new file consisting of the first line of the
- X # old, the header info and then the rest of the old file.
- X #
- X first_line="`head -1 $i`"
- X case "$first_line" in
- X \#!*)
- X #
- X # Special #! directive. Make it the first line of the new file.
- X #
- X $echo "$first_line" > $new_file
- X $echo "$header_info" >> $new_file
- X tail +2 $i >> $new_file
- X ;;
- X
- X *)
- X #
- X # A normal file.
- X #
- X $echo "$header_info" > $new_file
- X cat $i >> $new_file
- X ;;
- X esac
- X
- X #
- X # Check that everything went ok.
- X #
- X if [ $? -ne 0 ]
- X then
- X $warning "could not create new file for $dir/${i}, Aborting!"
- X exit_status=1
- X exit
- X fi
- X ;;
- X
- X *)
- X #
- X # A normal file, just cat the header and the file into a new file.
- X #
- X
- X $echo "$header_info" > $new_file
- X cat $i >> $new_file
- X
- X #
- X # Check to see that the cat went ok.
- X # If not we don't want to proceed or we might clobber the original without
- X # having anything to replace it with.
- X #
- X if [ $? -ne 0 ]
- X then
- X $warning "could not create new file for $dir/${i}, Aborting!"
- X exit_status=1
- X exit
- X fi
- X ;;
- X esac
- X
- X #
- X # Copy new_file (don't mv). It will be clobbered next time around or
- X # removed if this is the last time.
- X #
- X $X cp $new_file $i
- X
- X #
- X # Check to see how the cp went.
- X # If it failed then $i is still intact (hopefully).
- X #
- X if [ $? -ne 0 ]
- X then
- X $warning "could not copy $new_file to $dir/${i}, Aborting!"
- X exit_status=1
- X exit
- X fi
- X
- X $report RCS $add_str information added to $dir/$i
- X fi
- X else
- X #
- X # The header information was already there.
- X #
- X
- X $verbose RCS Header and Log information is present in $dir/$i
- X
- X case "$check_in" in
- X 0)
- X #
- X # They just wanted to add the info, but it was there already.
- X #
- X $report $dir/$i already contains Header/Log information.
- X exit_status=1
- X continue
- X ;;
- X esac
- X
- X #
- X # Ci with -k if this has never been checked in before.
- X # This will let RCS use the already present version number correctly.
- X #
- X if [ ! -f RCS/${i},v ]
- X then
- X $verbose $dir/RCS/${i},v does not exist, check in will use -k.
- X minus_k=-k
- X fi
- X fi
- X
- X #
- X # If they don't want to check in then go on to the next file.
- X #
- X case "$check_in" in
- X 0) continue ;;
- X esac
- X
- X #
- X # Check it in...
- X #
- X # If there is an unrecognised (by RCS) comment style, do the
- X # rcs -i first so that we can call rcs -c on the RCS file
- X # before we do the ci -u. This is because ci -u will do a co and
- X # we want to have the comment string already set up when that
- X # happens - otherwise the immediately checked out version will
- X # differ from the one we just checked in.
- X #
- X
- X $report checking in $dir/$i
- X
- X case "$comment" in
- X
- X "")
- X case "$x" in
- X "") $echo Auto-checkin done by $myname | ci -q $ci_flags $minus_k $i ;;
- X *) $report "$echo Auto-checkin done by $myname | ci -q $ci_flags $minus_k $i" ;;
- X esac
- X ;;
- X *)
- X case "$x" in
- X "") $echo Auto-checkin done by $myname | rcs -q -i -c"$comment" $i ;;
- X *) $report "$echo Auto-checkin done by $myname | rcs -q -i -c'$comment' $i" ;;
- X esac
- X $x ci -q $ci_flags $minus_k $i
- X ;;
- X esac
- Xdone
- END_OF_FILE
- if test 19368 -ne `wc -c <'rcsify'`; then
- echo shar: \"'rcsify'\" unpacked with wrong size!
- fi
- # end of 'rcsify'
- fi
- if test -f 'rcsify.1' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'rcsify.1'\"
- else
- echo shar: Extracting \"'rcsify.1'\" \(5455 characters\)
- sed "s/^X//" >'rcsify.1' <<'END_OF_FILE'
- X.\"
- X.\" $Header: /home/cogsci1/u2/terry/s/rcsify/RCS/rcsify.1,v 1.1 90/12/07 07:37:54 terry Exp Locker: terry $
- X.\"
- X.\"
- X.\" $Log: rcsify.1,v $
- X.\\" Revision 1.1 90/12/07 07:37:54 terry
- X.\\" Initial revision
- X.\\"
- X.\\"
- X.\"
- X.TH RCSIFY 1 ""
- X.SH NAME
- Xrcsify \- Convert files/directories to use RCS.
- X.SH SYNOPSIS
- X.B rcsify
- X[ \-aflmNnqruv ]
- X[ files... ]
- X.SH DESCRIPTION
- X.B Rcsify
- Xinserts RCS Log and Header fields into files, creates an RCS directory
- X(if one is not already present) and checks in the files. By default it
- Xwill check in only files with a recognised suffix (see below). Files
- Xthat already contain RCS Header or Log information are checked in with
- X\fBci \-k\fR.
- X.B Rcsify
- Xalso determines the comment type appropriate to the files and uses
- X.B rcs \-c
- Xto set the correct string.
- X
- X.I file
- Xwill usually be a file in the current directory, but it is also
- Xpossible to give a filename containing path information. In this case
- X.B rcsify
- Xwill create the RCS revision group in the appropriate directory.
- XUse the \-v and \-n options (see below) if you are unsure about the action(s)
- Xthat
- X.B rcsify
- Xwill take.
- X.SH FILE TYPES
- X.B Rcsify
- Xcurrently recognises the following file suffixes:
- X.TP
- X.B ,v
- XRCS revision group files. These are moved to the RCS directory if they are
- Xnot already there.
- X.TP
- X.B .awk
- XAwk scripts.
- X.TP
- X.B .c
- XC files.
- X.TP
- X.B .c++
- XC++ files.
- X.TP
- X.B .cl
- XCommon lisp files.
- X.TP
- X.B .el
- XEmacs lisp files.
- X.TP
- X.B .gperf
- XGNU gperf files.
- X.TP
- X.B .h
- XC language header files.
- X.TP
- X.B .latex
- XLatex files.
- X.TP
- X.B .lex
- XLex files.
- X.TP
- X.B .lisp
- XLisp files.
- X.TP
- X.B .lsp
- XLisp files.
- X.TP
- X.B .man
- XTroff man pages.
- X.TP
- X.B .[1-6]
- XTroff man pages.
- X.TP
- X.B .me
- XTroff me macro files.
- X.TP
- X.B .mm
- XTroff mm macro files.
- X.TP
- X.B .ms
- XTroff ms macro files.
- X.TP
- X.B .perl
- XPerl scripts.
- X.TP
- X.B .s
- XAssembler files.
- X.TP
- X.B .scm
- XScheme files.
- X.TP
- X.B .sh
- XShell scripts.
- X.TP
- X.B .ss
- XScheme files.
- X.TP
- X.B .tex
- XTex files.
- X.TP
- X.B .texinfo
- XGNU texinfo files.
- X.TP
- X.B .ti
- XTerminfo files.
- X.TP
- X.B .y
- XYacc files.
- X.SH OPTIONS
- X.B Rcsify
- Xtakes a variety of options which can be used to control various
- Xaspects of its behaviour, such as check in style, file type recognition,
- Xdiagnostic output and more. The meaning of each of the options is
- Xexplained below.
- X.TP
- X.B \-a
- XAll files. Normally
- X.B rcsify
- Xdoes not consider files that start with a leading dot. This option
- X(similar to the
- X.B \-a
- Xoption on
- X.BR ls )
- Xtells
- X.B rcsify
- Xto consider all files. However, "." and ".." are always ignored unless
- Xpresent on the command line that
- X.B rcsify
- Xwas invoked with.
- X.TP
- X.B \-f
- XUse
- X.BR file(1) .
- XNormally
- X.B rcsify
- Xrecognises files based solely on their suffixes, as given in the
- Xabove list. The
- X.B \-f
- Xoption tells
- X.B rcsify
- Xto use
- X.B file(1)
- Xto try to determine the file type in the event that the above suffix
- Xrecognition fails. If
- X.B file(1)
- Xrecognises the file as being of one of the above types then it is
- Xchecked in in exactly the same fashion as it would have been had
- Xit had the suffix. This is useful to force
- X.B rcsify
- Xto recognise (for example) troff source manual pages, or shell
- Xscripts whose names do not end with
- X.BR .sh .
- X.TP
- X.B \-l
- XCheck in with
- X.BR \-l .
- XNormally
- X.B rcsify
- Xchecks the files in with
- X.B ci -q
- X(quiet). This option adds
- X.B \-l
- Xto the check in flags. This results in an immediate
- X.B co \-l
- Xbeing done by
- X.BR ci .
- XSee the
- X.B \-l
- Xoption for
- X.BR ci(1) .
- X.TP
- X.B \-m
- XThis causes
- X.B rcsify
- Xto recognise makefiles. If a file named
- X"makefile", "Makefile", "GNUmakefile", "Imakefile" or "*.mk"
- Xis encountered, then it is treated as a makefile,
- Xthe appropriate header and log information is
- Xadded and the file is checked in.
- X.TP
- X.B \-N
- XNo check in.
- X.B Rcsify
- Xwill add the header and log fields to the files and create an
- XRCS directory if necessary, but will not check in any files.
- X.TP
- X.B \-n
- XThis is essentially the same as the
- X.B \-n
- Xoption for
- X.BR make(1) .
- XNo actions are actually performed but the usual
- Xdiagnostic messages appear as though
- X.B rcsify
- Xwere actually doing the work. This is very useful to
- Xcheck that what
- X.B rcsify
- Xwould do is sensible, before actually doing it.
- X.TP
- X.B \-q
- XQuiet mode.
- X.B Rcsify
- Xwill not print diagnostic messages to show what it is doing.
- XError messages will still appear.
- X.TP
- X.B \-r
- XRecursive. Normally, when
- X.B rcsify
- Xencounters a directory it is ignored. With the
- X.B \-r
- Xoption,
- X.B rcsify
- Xcalls itself on the subdirectory.
- X.TP
- X.B \-u
- XCheck in with
- X.BR \-u .
- XNormally
- X.B rcsify
- Xchecks the files in with
- X.B ci -q
- X(quiet). This option adds
- X.B \-u
- Xto the check in flags. This results in an immediate
- X.B co
- Xbeing done by
- X.BR ci .
- XSee the
- X.B \-u
- Xoption for
- X.BR ci(1) .
- X.TP
- X.B \-v
- XVerbose output. With this option
- X.B rcsify
- Xgives alot of information about what it is doing. This is
- Xvery useful with the
- X.B \-n
- Xoption.
- X.SH NOTES
- X.B Rcsify
- Xattempts to do the right thing to shell scripts, awk scripts and perl scripts
- Xwhich begin with the #! directive. It also deals with .lex, .y and .gperf files
- Xin a sensible fashion. Check the results if you have any worries.
- X.SH AUTHOR
- XTerry Jones
- X.br
- XCenter for Research on Concepts & Cognition
- X.br
- X510 North Fess
- X.br
- XIndiana University
- X.br
- XBloomington IN 47405 USA
- X.br
- X.SH SEE ALSO
- Xci(1L), ident(1L), rcs(1L), rcsdiff(1L), rcsintro(1L), rcsmerge(1L), rlog(1L),
- Xrcsfile(5L)
- X.sp 0
- XWalter F. Tichy, "Design, Implementation, and Evaluation of a Revision Control
- XSystem," in \fIProceedings of the 6th International Conference on Software
- XEngineering\fR, IEEE, Tokyo, Sept. 1982.
- END_OF_FILE
- if test 5455 -ne `wc -c <'rcsify.1'`; then
- echo shar: \"'rcsify.1'\" unpacked with wrong size!
- fi
- chmod +x 'rcsify.1'
- # end of 'rcsify.1'
- fi
- if test -f 'Makefile' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'Makefile'\"
- else
- echo shar: Extracting \"'Makefile'\" \(57 characters\)
- sed "s/^X//" >'Makefile' <<'END_OF_FILE'
- X
- Xrcsify.cat : rcsify.1
- X nroff -man rcsify.1 > rcsify.cat
- END_OF_FILE
- if test 57 -ne `wc -c <'Makefile'`; then
- echo shar: \"'Makefile'\" unpacked with wrong size!
- fi
- # end of 'Makefile'
- fi
- if test -f 'MANIFEST' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'MANIFEST'\"
- else
- echo shar: Extracting \"'MANIFEST'\" \(159 characters\)
- sed "s/^X//" >'MANIFEST' <<'END_OF_FILE'
- X
- XThis shar comes with the following files...
- X
- XMakefile..................57
- Xrcsify....................19368
- Xrcsify.1..................5455
- X
- XAnd this MANIFEST.
- X
- END_OF_FILE
- if test 159 -ne `wc -c <'MANIFEST'`; then
- echo shar: \"'MANIFEST'\" unpacked with wrong size!
- fi
- # end of 'MANIFEST'
- fi
- echo shar: End of shell archive.
- exit 0
-
-